package com.wxtl.dao;

import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.hibernate.LockMode;
import org.hibernate.Query;
import org.springframework.stereotype.Repository;

import com.wxtl.dao.base.HibernateBaseDao;
import com.wxtl.entity.LkAgentProduct;
import com.wxtl.util.DataGridModel;
import com.wxtl.util.Page;

import static org.hibernate.criterion.Example.create;


@Repository
public class LkAgentProductDAO extends HibernateBaseDao {
	private static final Log log = LogFactory.getLog(LkAgentProductDAO.class);

	/**
	 * 根据代理商查看所代理的产品
	 * @param dgm
	 * @param agentId
	 * @return
	 */
	public Page query(DataGridModel dgm,int agentId){
		String hql="from LkAgentProduct ap where ap.id.agentId=?";
		return super.queryForList(hql, new Object[]{agentId}, dgm.getPage(), dgm.getRows());
	}
}